package com.air.ota.vo;

import com.air.ota.util.HexStringUtil;

public class SZTCancelResultReqTransVO extends SZTBaseReqTransVO {
	
	protected byte[] cardAppSequence;
	protected byte[] result;
	protected byte[] mac2;
	protected byte[] tac;
	protected byte[] ewalletRemain;
	protected byte[] cardTransSequence;
	protected byte[] cardRandom;
	
	public SZTCancelResultReqTransVO(byte[] deviceSequence, byte[] sztSequence,String deviceTriggerTime,
			byte[] cardAppSequence,byte[] result,byte[] mac2,
			byte[] tac,byte[] ewalletRemain,
			byte[] cardTransSequence,byte[] cardRandom)throws Exception{
		
		super(deviceSequence, sztSequence,deviceTriggerTime);
		this.transTypeCode = 0x47;
		this.subTransTypeCode = 0x10;
		//this.cardPhyType = 0x02;
		this.tranAppendCode = 0x03;
		
		this.cardAppSequence = cardAppSequence;
		this.result = result;
		this.mac2 = mac2;
		this.tac = tac;
		this.ewalletRemain = ewalletRemain;
		this.cardTransSequence = cardTransSequence;
		this.cardRandom = cardRandom;
		
		this.transData  = makeTransData();
	}
	public byte[] makeTransData(){
		StringBuffer hexStringBuf = new StringBuffer();
		
		
		hexStringBuf.append(HexStringUtil.bytesToHexString(cardAppSequence));
		hexStringBuf.append(HexStringUtil.bytesToHexString(result));
		hexStringBuf.append(HexStringUtil.bytesToHexString(mac2));
		hexStringBuf.append(HexStringUtil.bytesToHexString(tac));
		hexStringBuf.append(HexStringUtil.bytesToHexString(ewalletRemain));
		hexStringBuf.append(HexStringUtil.bytesToHexString(cardTransSequence));
		hexStringBuf.append(HexStringUtil.bytesToHexString(cardRandom));
		
		return HexStringUtil.hexStringToBytes(hexStringBuf.toString());
	}
}
